<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex flex-wrap align-center justify-center benben-position-layout flex postquestionsDetails_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub postquestionsDetails_fd0_0'>
          <view class='flex flex-wrap align-center self-center postquestionsDetails_fd0_0_c0' @tap.stop="handleJumpDiy"
            data-type="back" data-url="1">
            <image class='postquestionsDetails_fd0_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"63.png"'></image>
          </view>
          <text class='postquestionsDetails_fd0_0_c1'>详情</text>
          <view class='flex flex-wrap align-center self-center justify-end postquestionsDetails_fd0_0_c0'
            @tap.stop="popupShow1704178252726=true">

            <image class='postquestionsDetails_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"105.png"'></image>
            <!-- #ifdef APP-PLUS -->
            <!-- #endif -->
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center postquestionsDetails_flex_1">
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout postquestionsDetails_flex_2">
        <view class='flex flex-wrap align-center justify-between postquestionsDetails_fd2_0'>
          <view class='flex flex-wrap align-center' @tap.stop="goHome" data-type="navigateTo"
            :data-url="`/pages/wode/myFans/userHome?uid=${postsDetails.user_id}`">
            <image class='postquestionsDetails_fd2_0_c0_c0' mode="aspectFit" :src='postsDetails.avatar'></image>
            <view class='flex flex-direction flex-wrap align-start'>
              <text class='postquestionsDetails_fd2_0_c0_c1_c0'>{{postsDetails.user_nickname}}</text>
              <view class='flex flex-wrap align-center postquestionsDetails_fd2_0_c0_c1_c1'>
                <text class='postquestionsDetails_fd2_0_c0_c1_c1_c0'>{{postsDetails.create_time}}</text>
                <text class='postquestionsDetails_fd2_0_c0_c1_c1_c1'>来自</text>
                <text class='postquestionsDetails_fd2_0_c0_c1_c1_c1'>{{postsDetails.user_school}}</text>
              </view>
            </view>
          </view>

          <view class="" v-if="isLogin && (postsDetails.user_id!=userInfo.id) && postsDetails.is_nm==0">
            <button class='postquestionsDetails_fd2_0_c1' @tap.stop="clickArticleFunc(postsDetails.is_follow)"
              v-if=" isLogin && postsDetails.is_follow==0">关注</button><button class='postquestionsDetails_fd2_0_c1_1'
              @tap.stop="clickArticleFunc(postsDetails.is_follow)"
              v-if="isLogin && postsDetails.is_follow=='1'">已关注</button>
          </view>

          <button class='postquestionsDetails_fd2_0_c1' @tap.stop="handleJumpDiy" data-type="navigateTo"
            :data-url="`/pages/fabu/postApost/postApost?aid=${id}&type=${postsDetails.type}`"
            v-if="isLogin && postsDetails.user_id==userInfo.id && postsDetails.check_status!=2">编辑</button>

        </view>
        <view class='flex flex-direction flex-wrap align-stretch postquestionsDetails_fd2_1'>
          <text class='postquestionsDetails_fd2_1_c0'>{{postsDetails.title}}</text>
          <text class='postquestionsDetails_fd2_1_c1'>{{postsDetails.content}}</text>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch postquestionsDetails_fd2_2'
          v-if=" postsDetails.is_arr==1">
          <view class='flex flex-wrap align-center'>
            <text class='postquestionsDetails_fd2_0_c0_c1_c0'>{{postsDetails.array_title}}</text>
          </view>
          <template v-for='(item,key0) in postsDetails.array_info'>
            <view class='flex flex-wrap align-center postquestionsDetails_fd2_2_c1' :key='key0'
              @click.stop="godetail(item)">
              <text class='postquestionsDetails_fd2_2_c1_c0'>{{item.title}}</text>
            </view>
          </template>

        </view>

        <view class='flex flex-direction flex-wrap align-stretch postquestionsDetails_fd2_4'
          v-if=" postsDetails.question_type!=1">
          <benben-select-diy ref="showSelectPopup1705841894872" class-name='flex flex-direction align-stretch flex'
            :items.sync="postsDetails.operation_info" v-model="postsDetails.postoperate_id" default-type="value"
            default-label="name" :allow-cancel='false' type="radio" :disabled='true'>
            <template v-for='(item,key0) in postsDetails.operation_info'>
              <view v-if="item.isSelected"
                class='flex align-center justify-between flex postquestionsDetails_fd2_4_c0_c0' :key="key0"
                @tap="goClick(item,key0)">
                <text class='postquestionsDetails_fd2_4_c0_c0_c0'>{{item.num}}、{{item.operation}}</text>
                <view class='flex flex-wrap align-center'>
                  <text class='postquestionsDetails_fd2_4_c0_c0_c1_c0'>{{item.rate}}%</text>
                </view>
              </view>
              <view v-else class='flex align-center justify-between flex postquestionsDetails_fd2_4_c0_c1' :key="key0"
                @tap="goClick(item,key0)">
                <text class='postquestionsDetails_fd2_4_c0_c0_c0'>{{item.num}}、{{item.operation}}</text>
                <view class='flex flex-wrap align-center'>
                  <text>{{item.rate}}%</text>
                </view>
              </view>
            </template>
          </benben-select-diy>
        </view>
        <view class='flex flex-wrap align-center postquestionsDetails_fd2_3' v-if="postsDetails.images.length">
          <template v-for='(item,key0) in postsDetails.images'>
            <view class='flex flex-wrap align-center' :key='key0' @click.stop="preVeImage(key0,postsDetails.images)">
              <image class='postquestionsDetails_fd2_3_c0_c0' mode="aspectFill" :src='item'></image>
            </view>
          </template>

        </view>
        <view class='flex flex-wrap align-center postquestionsDetails_fd2_5'>
          <view class='flex flex-wrap align-center postquestionsDetails_fd2_5_c0' v-if="postsDetails.address">
            <image class='postquestionsDetails_fd2_5_c0_c0' mode="aspectFit" :src='STATIC_URL+"64.png"'></image>
            <text class='postquestionsDetails_fd2_0_c0_c1_c1_c0'>{{postsDetails.address}}</text>
          </view>
          <text v-if="postsDetails.type==2"
            class='postquestionsDetails_fd2_5_c1'>类型为{{postsDetails.question_type_name}}，结束时间为{{postsDetails.end_time || '永不过期' }}</text>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <benben-popup v-model="popupShow1704178252726" :mask="true" :mask-close-able="false" mode='bottom' :z-index='999'>
        <!---分享flex布局开始-->
        <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
          <view class='flex flex-direction flex-wrap align-stretch postquestionsDetails_fd3_0'>
            <view class='flex flex-wrap align-center justify-between postquestionsDetails_fd3_0_c0'>
              <view class='flex flex-wrap align-center postquestionsDetails_fd3_0_c0_c0'>
              </view>
              <view class='flex flex-wrap align-center justify-center postquestionsDetails_fd3_0_c0_c1'>
                <text class='postquestionsDetails_fd3_0_c0_c1_c0'>更多</text>
              </view>
              <view class='flex flex-wrap align-center postquestionsDetails_fd3_0_c0_c2'>
                <image class='postquestionsDetails_fd3_0_c0_c2_c0' mode="aspectFit" :src='STATIC_URL+"69.png"'
                  @tap.stop="popupShow1704178252726=false"></image>
              </view>
            </view>
            <view class='flex flex-wrap align-center justify-around postquestionsDetails_fd3_0_c1'>
              <view class='flex flex-direction flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
                :data-url="`/pages/shouye/selectFriends/selectFriends?postquestion_id=${id}`">
                <image class='postquestionsDetails_fd3_0_c1_c0_c0' mode="aspectFit" :src='STATIC_URL+"72.png"'></image>
                <text class='postquestionsDetails_fd3_0_c1_c0_c1'>私信好友</text>
              </view>
              <view class='flex flex-direction flex-wrap align-center' @click="shareApp">
                <image class='postquestionsDetails_fd3_0_c1_c0_c0' mode="aspectFit" :src='STATIC_URL+"71.png"'></image>
                <text class='postquestionsDetails_fd3_0_c1_c0_c1'>微信好友</text>
              </view>
              <view class='flex flex-direction flex-wrap align-center'
                v-if="isLogin && (postsDetails.user_id!=userInfo.id)" @tap="handleJumpDiy" data-type="navigateTo"
                :data-url="`/pages/shouye/complainData/complainData?type=1&posts_id=${postsDetails.aid}`">
                <image class='postquestionsDetails_fd3_0_c1_c0_c0' mode="aspectFit" :src='STATIC_URL+"70.png"'></image>
                <text class='postquestionsDetails_fd3_0_c1_c0_c1'>投诉</text>
              </view>
              <view class='flex flex-direction flex-wrap align-center'
                v-if="isLogin && (postsDetails.user_id==userInfo.id)" @click.stop="delpostdetail">
                <image class='postquestionsDetails_fd3_0_c1_c0_c0' mode="aspectFit" :src='STATIC_URL+"90.png"'></image>
                <text class='postquestionsDetails_fd3_0_c1_c0_c1'>删除</text>
              </view>
            </view>
          </view>
        </view>

        <!---分享flex布局结束-->

      </benben-popup>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center postquestionsDetails_flex_4">
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout postquestionsDetails_flex_5">
        <view class='flex flex-wrap align-center'>
          <text class='postquestionsDetails_fd5_0_c0'>共</text>
          <text class='postquestionsDetails_fd5_0_c0'>{{postsDetails.comment_number}}</text>
          <text class='postquestionsDetails_fd5_0_c0'>条评论</text>
        </view>
        <template v-for='(item,key0) in commentList'>
          <view class='flex flex-wrap align-start postquestionsDetails_fd5_1' :key='key0'
            @tap.stop="goChilder(item.user_id)" data-type="navigateTo"
            :data-url="`/pages/wode/myFans/userHome?uid=${item.user_id}`">
            <image class='postquestionsDetails_fd5_1_c0' mode="aspectFit" :src='item.avatar'></image>
            <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
              <view class='flex flex-wrap align-center'>
                <text class='postquestionsDetails_fd5_1_c1_c0_c0'>{{item.user_nickname}}</text>
                <text class='postquestionsDetails_fd5_1_c1_c0_c1' v-if="postsDetails.user_id==item.id">作者</text>
                <!-- <text class='postquestionsDetails_fd5_1_c1_c0_c2'>{{item.huifu}}</text> -->
              </view>
              <view class='flex flex-wrap align-center postquestionsDetails_fd5_1_c1_c1'>
                <text class='postquestionsDetails_fd5_1_c1_c1_c0'>来自</text>
                <text class='postquestionsDetails_fd5_1_c1_c1_c1'>{{item.user_school}}</text>
              </view>
              <view class='flex flex-wrap align-center postquestionsDetails_fd5_1_c1_c2'>
                <text class='postquestionsDetails_fd5_1_c1_c2_c0'>{{item.content}}</text>
              </view>
              <view class='flex flex-wrap align-center justify-between postquestionsDetails_fd5_1_c1_c2'>
                <text class='postquestionsDetails_fd5_1_c1_c1_c1'>{{item.create_time}}</text>
                <view class='flex flex-wrap align-center'>
                  <view class='flex flex-wrap align-center postquestionsDetails_fd5_1_c1_c3_c1_c0'
                    @click.stop="replayShow(item)">
                    <image class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c0' mode="aspectFit"
                      :src='STATIC_URL+"67.png"'></image>
                    <text class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c1'>{{item.reply_num|| 0}}</text>
                  </view>
                  <view class='flex flex-wrap align-center' @click.stop="likepinglun(item,item.is_support,'3')">
                    <image class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c0' v-if="item.is_support==0" mode="aspectFit"
                      :src='STATIC_URL+"65.png"'></image>
                    <image class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c0' v-else mode="aspectFit"
                      :src='STATIC_URL+"119.png"'>
                      <text class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c1'>{{item.support_number}}</text>
                  </view>
                  <image style="margin: 0rpx 0rpx 0rpx 24rpx;" class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c0'
                    v-if=" isLogin && userInfo.id==item.user_id" mode="aspectFit" :src='STATIC_URL+"75.png"'
                    @click.top="delPinglun(item,key0)"></image>
                </view>
              </view>
              <template v-for='(child,key1) in item.son_info'>
                <view class='flex flex-wrap align-center postquestionsDetails_fd5_1_c1_c4' :key='key1'
                  @tap.stop="goChilder(child.user_id)" data-type="navigateTo"
                  :data-url="`/pages/wode/myFans/userHome?uid=${child.user_id}`">
                  <view class='flex flex-wrap align-start postquestionsDetails_fd5_1'>
                    <image class='postquestionsDetails_fd5_1_c0' mode="aspectFit" :src='child.avatar'></image>
                    <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
                      <view class='flex flex-wrap align-center'>
                        <text class='postquestionsDetails_fd5_1_c1_c0_c1'
                          v-if="postsDetails.user_id==child.user_id">作者</text>
                        <text class='postquestionsDetails_fd5_1_c1_c0_c0'>{{child.user_nickname}}</text>

                        <text class='postquestionsDetails_fd5_1_c1_c0_c2'>{{child.huifu}}</text>
                      </view>
                      <view class='flex flex-wrap align-center postquestionsDetails_fd5_1_c1_c1'>
                        <text class='postquestionsDetails_fd5_1_c1_c1_c0'>来自</text>
                        <text class='postquestionsDetails_fd5_1_c1_c1_c1'>{{child.user_school}}</text>
                      </view>
                      <view class='flex flex-wrap align-center postquestionsDetails_fd5_1_c1_c2'>
                        <text class='postquestionsDetails_fd5_1_c1_c2_c0'>{{child.content}}</text>
                      </view>

                      <view class='flex flex-wrap align-center justify-between postquestionsDetails_fd5_1_c1_c2'
                        style="width: 500rpx;">
                        <text class='postquestionsDetails_fd5_1_c1_c1_c1'>{{child.create_time}}</text>

                        <view class='flex flex-wrap align-center'>

                          <view class='flex flex-wrap align-center postquestionsDetails_fd5_1_c1_c3_c1_c0'
                            @click.stop="replayShow(child)">
                            <image class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c0' mode="aspectFit"
                              :src='STATIC_URL+"67.png"'></image>
                            <!-- <text class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c1'>{{child.reply_num|| 0}}</text> -->
                          </view>
                          <view class='flex flex-wrap align-center'
                            @click.stop="likepinglun(child,child.is_support,'3')">
                            <image class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c0' v-if="child.is_support==0"
                              mode="aspectFit" :src='STATIC_URL+"65.png"'></image>
                            <image class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c0' v-else mode="aspectFit"
                              :src='STATIC_URL+"119.png"'>
                              <text class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c1'>{{child.support_number}}</text>
                          </view>
                          <image style="margin: 0rpx 0rpx 0rpx 24rpx;" v-if=" isLogin && userInfo.id==child.user_id"
                            class='postquestionsDetails_fd5_1_c1_c3_c1_c0_c0' mode="aspectFit"
                            :src='STATIC_URL+"75.png"' @click.top="delPinglun(child,key1)"></image>
                        </view>
                      </view>
                    </view>
                  </view>
                </view>
              </template>

            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->
      <view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex postquestionsDetails_flex_6">
        <!-- @blur="handleBlur" -->
        <view class='flex flex-wrap align-center justify-between flex-sub postquestionsDetails_fd6_0'>
          <view class='flex flex-wrap align-center flex-sub postquestionsDetails_fd6_0_c0'>
            <benben-input type="text" style="width: 100%;" :placeholder="palcetile" confirm-type="done" :focus="isfocus"
              :maxlength="-1" placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
              @confirm="commentAnswerFunc()" @focus="handleFocus" v-model="content" />
          </view>
          <view class="text-df text-white btnssss" @click.stop="commentAnswerFunc()" v-if="isfocus">发送</view>
          <view class='flex flex-wrap align-center' v-if="!isfocus">
            <view class='flex flex-direction flex-wrap align-center postquestionsDetails_fd6_0_c1_c0'
              @click="like(postsDetails.is_support)">
              <image class='postquestionsDetails_fd6_0_c1_c0_c0' v-if="postsDetails.is_support==0" mode="aspectFit"
                :src='STATIC_URL+"65.png"'></image>
              <image class='postquestionsDetails_fd6_0_c1_c0_c0' v-else mode="aspectFit" :src='STATIC_URL+"119.png"'>
              </image>
              <text class='postquestionsDetails_fd6_0_c1_c0_c1'>{{postsDetails.support_number}}</text>
            </view>
            <view class='flex flex-direction flex-wrap align-center'
              @click.stop="collection(postsDetails.is_collection)">
              <image class='postquestionsDetails_fd6_0_c1_c0_c0' mode="aspectFit" v-if="postsDetails.is_collection==0"
                :src='STATIC_URL+"66.png"'></image>
              <image class='postquestionsDetails_fd6_0_c1_c0_c0' mode="aspectFit" v-else :src='STATIC_URL+"118.png"'>
              </image>
              <text class='postquestionsDetails_fd6_0_c1_c0_c1'>{{postsDetails.collection_number}}</text>
            </view>
          </view>
        </view>

      </view>
      <view :style="{height: '98rpx'}"></view>


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "popupShow1704178252726": false,
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "postsDetails": {
          "aid": "",
          "type": "",
          "user_nickname": "",
          "title": "",
          "content": "",
          "images": [],
          "is_nm": "",
          "support_number": "",
          "collection_number": "",
          "comment_number": "",
          "end_time": "",
          "is_end": "",
          "question_type": "",
          "address": "",
          "create_time": "",
          "user_id": "",
          "postoperate_id": "",
          "avatar": "",
          "is_follow": "",
          "array_title": "",
          "array_info": []
        },
        "commentList": [],
        "content": "",
        "pid": 0,
        "id": "1",
        palcetile: '说点什么',
        isfocus: false,
        to_user_id: '',
        hufiuId: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      },
      userInfo: {
        get() {
          return this.$store.state.userInfo.userinfo
        },
        set() {
          this.$store.commit('updateUserInfo', value)
        },
      },
    },
    watch: {},
    onLoad(options) {
      let {
        id
      } = options
      if (id !== undefined) this.id = id
      console.log('userInfo', this.userInfo)
      this.getpostDetailsFunc()
      this.getcommentListFunc()
      uni.onKeyboardHeightChange((res) => {
        // this.keyboardHeight = res.height;
        if (res.height > 0) {
          console.log('键盘已经开启');
          this.isfocus = true
          // 在这里执行键盘开启时需要进行的操作
        } else {
          console.log('键盘已经关闭');
          this.isfocus = false
          this.palcetile = '说点什么'
          this.hufiuId = ''
          this.pid = 0
          // 在这里执行键盘关闭时需要进行的操作
        }
      });
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {
      // this.popupShow1704178252726 = false
      this.popupShow1704178252726()
    },
    onResize() {

    },
    onPullDownRefresh() {
      this.getcommentListFunc()
    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      goChilder(uid) {
        if (uid == this.userInfo.id) {
          uni.switchTab({
            url: `/pages/tabBar/myPosts/myPosts`
          })
        } else {
          uni.navigateTo({
            url: `/pages/wode/myFans/userHome?uid=${uid}`
          })
        }
      },
      goHome() {
        if (this.postsDetails.is_nm != 1) {
          if (this.postsDetails.user_id == this.userInfo.id) {
            uni.switchTab({
              url: `/pages/tabBar/myPosts/myPosts`
            })
          } else {
            uni.navigateTo({
              url: `/pages/wode/myFans/userHome?uid=${this.postsDetails.user_id}`
            })
          }
        }
      },
      // 删除评论
      delPinglun(item, index) {
        let that = this
        uni.showModal({
          title: '提示',
          content: '确定要删除该评论吗？',
          success: function(res) {
            if (res.confirm) {
              that.$api.post(global.apiUrls.post662751d563a8c, {
                aid: item.aid,
              }).then(resule => {
                if (resule.data.code == 1) {
                  that.getcommentListFunc()
                } else {
                  that.$message.info(resule.data.msg)
                }
              })
            }
          }
        });

      },
      delpostdetail() {
        this.$api.post(global.apiUrls.post657bbc049f559, {
          aid: this.postsDetails.aid,
        }).then(res => {
          if (res.data.code == 1) {
            uni.navigateBack()
          } else {
            this.$message.info(res.data.msg)
          }
        })
      },
      goClick(item, key0) {
        console.log('lllllll', item)
        if (this.postsDetails.user_id == this.userInfo.id) {
          this.$message.info('您不能为自己投票')
          return;
        }
        if (this.postsDetails.is_choose == 1) {
          this.$message.info('您已经投过票了,不可重复投票')
          return;
        }

        this.$refs.showSelectPopup1705841894872.tapHandle(key0)
        this.$api.post(global.apiUrls.post657914e009af0, {
          content: item.operation,
          is_q: 0,
          pid: 0,
          postquestion_id: this.id,
          reply_num: item.num
        }).then(res => {
          if (res.data.code == 1) {
            this.getpostDetailsFunc()
            this.getcommentListFunc()
            // this.$message.info(res.data.msg)
            this.$message.info('投票成功')
          } else {
            this.$message.info(res.data.msg)
          }
        })
      },
      godetail(item) {
        // this.id = item.aid
        // this.getpostDetailsFunc()
        // this.getcommentListFunc()
        uni.navigateTo({
          url: `/pages/shouye/postquestionsDetails/postquestionsDetailsnext?id=${item.aid}`
        })
      },
      shareApp() {
        uni.share({
          provider: 'weixin',
          scene: 'WXSceneSession',
          imageUrl: '/static/logo.png',
          title: this.postsDetails.title,
          href: this.postsDetails.share_url,
          success: function(res) {
            console.log('22222')
            // uni.showToast({
            //   title: '分享成功',
            //   icon: 'none'
            // })
            console.log("success:" + JSON.stringify(res));
          },
          fail: function(err) {
            this.$message.info('分享失败')
            console.log("fail:" + JSON.stringify(err));
          }
        });
      },
      //获取帖子详情
      async getpostDetailsFunc() {
        //请求方法
        //数据验证

        let datapostsDetails = await this.$api.post(global.apiUrls.post6577fe761d487, {
          aid: this.id,
          user_id: this.userInfo ? this.userInfo.id : ''
        });

        if (datapostsDetails.data.code != 1) {
          this.$message.info(datapostsDetails.data.msg);
          return
        }
        let infopostsDetails = datapostsDetails.data;
        this.postsDetails = infopostsDetails.data

      },
      //获取评论列表
      getcommentListFunc() {
        this.minixPagingListsApi = global.apiUrls.post657812e2b7c89;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          postquestion_id: this.id
        }
        this.listData = [];
        this.commentList = this.listData;
        this.pagingListToggle();

      },
      //点击关注取消
      async clickArticleFunc(action) {
        //请求方法
        //数据验证

        let data657822ffc15db = await this.$api.post(global.apiUrls.post657822ffc15db, {
          user_id_2: this.postsDetails.user_id,
          action: action == 0 ? '1' : '0'
        });

        if (data657822ffc15db.data.code != 1) {
          this.$message.info(data657822ffc15db.data.msg);
          return
        }
        this.getpostDetailsFunc()
      },
      async likepinglun(item, action, type) {
        let data657822ffc15db = await this.$api.post(global.apiUrls.post657910f8d85a1, {
          postquestion_id: this.postsDetails.aid,
          postcomment_id: item.aid,
          action: action == 0 ? 1 : 0,
          type: this.postsDetails.type == 1 ? '3' : '4',
          to_user_id: item.user_id
        });

        if (data657822ffc15db.data.code != 1) {
          this.$message.info(data657822ffc15db.data.msg);
          return
        }
        if (item.is_support == 0) {
          item.is_support = 1
          item.support_number = item.support_number + 1
        } else {
          item.is_support = 0
          item.support_number = item.support_number - 1
        }
        // this.getcommentListFunc()
      },
      //点赞
      async like(action) {
        //请求方法
        //数据验证

        let data657822ffc15db = await this.$api.post(global.apiUrls.post657910f8d85a1, {
          postquestion_id: this.postsDetails.aid,
          action: action == 0 ? 1 : 0,
          type: this.postsDetails.type
        });

        if (data657822ffc15db.data.code != 1) {
          this.$message.info(data657822ffc15db.data.msg);
          return
        }
        uni.$emit("dianzan", {
          id: this.postsDetails.aid
        });
        this.getpostDetailsFunc()
      },
      // 预览图片
      preVeImage(index, list) {
        uni.previewImage({
          urls: list,
          current: index
        })
      },
      // 收藏
      async collection(action) {
        //请求方法
        //数据验证

        let data657822ffc15db = await this.$api.post(global.apiUrls.post6578266d977f5, {
          postquestion_id: this.postsDetails.aid,
          type: this.postsDetails.type,
          action: action == 0 ? 1 : 0
        });

        if (data657822ffc15db.data.code != 1) {
          this.$message.info(data657822ffc15db.data.msg);
          return
        }
        uni.$emit("shoucang", {
          id: this.postsDetails.aid,
        });
        this.getpostDetailsFunc()
      },
      replayShow(item) {
        this.palcetile = `回复${item.user_nickname}`
        this.hufiuId = item.aid
        this.pid = item.aid
        this.isfocus = true
        this.to_user_id = item.user_id
        console.log('pid', this.pid)
      },
      handleBlur() {
        this.isfocus = false
        this.palcetile = '说点什么'
        // this.hufiuId = ''
        // this.pid = 0
      },
      handleFocus() {
        this.isfocus = true
      },
      //
      async commentAnswerFunc() {
        //请求方法
        //数据验证
        console.log('ppp')
        let data657914e009af0 = await this.$api.post(global.apiUrls.post657914e009af0, {
          content: this.content,
          is_q: '0',
          pid: this.pid,
          postquestion_id: this.postsDetails.aid,
          to_user_id: this.to_user_id
        });

        if (data657914e009af0.data.code != 1) {
          this.$message.info(data657914e009af0.data.msg);
          return
        }
        this.content = '';
        this.palcetile = '说点什么'
        this.isfocus = false
        this.pid = ''
        this.getcommentListFunc()
        this.getpostDetailsFunc()
      },
      // 评论
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .btnssss {
    width: 110rpx;
    height: 60rpx;
    line-height: 60rpx;
    background-color: #6450eb;
    border-radius: 33rpx;
    text-align: center;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
  }

  .postquestionsDetails_flex_0 {
    background: rgba(255, 255, 255, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .postquestionsDetails_fd0_0_c2_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd0_0_c1 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
  }

  .postquestionsDetails_fd0_0_c0_c0 {
    width: 18rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd0_0_c0 {
    width: 50rpx;
    height: 50rpx;
  }

  .postquestionsDetails_fd0_0 {
    height: 88rpx;
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .postquestionsDetails_flex_1 {
    background: rgba(248, 248, 248, 1);
    background-size: 100% auto;
    height: 20rpx;
  }

  .postquestionsDetails_flex_2 {
    padding: 0rpx 0rpx 28rpx 0rpx;
  }

  .postquestionsDetails_fd2_5_c1 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .postquestionsDetails_fd2_5_c0_c0 {
    width: 30rpx;
    height: 30rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 6rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd2_5_c0 {
    border: 1px solid rgba(153, 153, 153, 1);
    padding: 8rpx 20rpx 8rpx 20rpx;
    border-radius: 50rpx;
  }

  .postquestionsDetails_fd2_5 {
    margin: 28rpx 32rpx 0rpx 32rpx;
  }

  .postquestionsDetails_fd2_4_c0_c1 {
    background: rgba(248, 248, 248, 1);
    margin: 0rpx 0rpx 20rpx 0rpx;
    padding: 24rpx 40rpx 24rpx 40rpx;
    border-radius: 16rpx;
    background-size: 100% auto;
  }

  .postquestionsDetails_fd2_4_c0_c0_c1_c0 {
    color: #6450EB;
    font-size: 28rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .postquestionsDetails_fd2_4_c0_c0_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .postquestionsDetails_fd2_4_c0_c0 {
    background: rgba(100, 80, 235, 0.1);
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 24rpx 40rpx 24rpx 40rpx;
    margin: 0rpx 0rpx 20rpx 0rpx;
  }

  .postquestionsDetails_fd2_4 {
    margin: 24rpx 32rpx 0rpx 32rpx;
  }

  .postquestionsDetails_fd2_3_c0_c0 {
    width: 210rpx;
    height: 210rpx;
    border-radius: 8rpx;
    margin: 0rpx 10rpx 10rpx 0rpx;
  }

  .postquestionsDetails_fd2_3 {
    margin: 24rpx 22rpx 0rpx 32rpx;
  }

  .postquestionsDetails_fd2_2_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 28rpx;
  }

  .postquestionsDetails_fd2_2_c1 {
    background: rgba(255, 255, 255, 1);
    margin: 24rpx 0rpx 0rpx 0rpx;
    padding: 24rpx 40rpx 24rpx 40rpx;
    border-radius: 16rpx;
    background-size: 100% auto;
  }

  .postquestionsDetails_fd2_2 {
    background: rgba(248, 248, 248, 1);
    margin: 32rpx 32rpx 0rpx 32rpx;
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 24rpx;
  }

  .postquestionsDetails_fd2_1_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
    color: #333333;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 42rpx;
  }

  .postquestionsDetails_fd2_1_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 700;
    line-height: 42rpx;
  }

  .postquestionsDetails_fd2_1 {
    margin: 40rpx 32rpx 0rpx 32rpx;
  }

  .postquestionsDetails_fd2_0_c1_1 {
    border: 1px solid rgba(153, 153, 153, 1);
    background: rgba(255, 255, 255, 1);
    border-radius: 33rpx 33rpx 33rpx 33rpx;
    width: 112rpx;
    line-height: 56rpx;
    font-size: 24rpx;
    color: rgba(153, 153, 153, 1);
  }

  .postquestionsDetails_fd2_0_c1 {
    background: rgba(100, 80, 235, 1);
    border-radius: 33rpx 33rpx 33rpx 33rpx;
    width: 112rpx;
    line-height: 56rpx;
    font-size: 24rpx;
    color: #fff;
  }

  .postquestionsDetails_fd2_0_c0_c1_c1_c1 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 0rpx 0rpx 12rpx;
  }

  .postquestionsDetails_fd2_0_c0_c1_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .postquestionsDetails_fd2_0_c0_c1_c1 {
    margin: 6rpx 0rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd2_0_c0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .postquestionsDetails_fd2_0_c0_c0 {
    width: 80rpx;
    height: 80rpx;
    border-radius: 100rpx;
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd2_0 {
    margin: 32rpx 32rpx 0rpx 32rpx;
  }

  .postquestionsDetails_fd3_0_c1_c0_c1 {
    font-size: 24rpx;
    font-weight: 400;
    color: #333;
  }

  .postquestionsDetails_fd3_0_c1_c0_c0 {
    width: 102rpx;
    height: 102rpx;
    border-radius: 100rpx;
    margin: 0rpx 0rpx 16rpx 0rpx;
  }

  .postquestionsDetails_fd3_0_c1 {
    padding: 0rpx 0rpx 58rpx 0rpx;
  }

  .postquestionsDetails_fd3_0_c0_c2_c0 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 20rpx 20rpx 20rpx 20rpx;
  }

  .postquestionsDetails_fd3_0_c0_c2 {
    margin: 0rpx 2rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd3_0_c0_c1_c0 {
    font-size: 32rpx;
    font-weight: 700;
    color: #333;
    margin: 0rpx 16rpx 0rpx 16rpx;
  }

  .postquestionsDetails_fd3_0_c0_c1 {
    padding: 40rpx 0rpx 48rpx 0rpx;
  }

  .postquestionsDetails_fd3_0_c0_c0 {
    width: 40rpx;
  }

  .postquestionsDetails_fd3_0_c0 {
    padding: 0rpx 13rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd3_0 {
    background: #fff;
    background-size: 100% auto !important;
    border-radius: 24rpx 24rpx 0rpx 0rpx;
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .postquestionsDetails_flex_4 {
    background: rgba(248, 248, 248, 1);
    height: 20rpx;
    background-size: 100% auto;
  }

  .postquestionsDetails_flex_5 {
    padding: 32rpx 32rpx 80rpx 32rpx;
  }

  .postquestionsDetails_fd5_1_c1_c4 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd5_1_c1_c3_c1_c0_c1 {
    color: #999999;
    font-size: 20rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .postquestionsDetails_fd5_1_c1_c3_c1_c0_c0 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 4rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd5_1_c1_c3_c1_c0 {
    margin: 0rpx 36rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd5_1_c1_c2_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .postquestionsDetails_fd5_1_c1_c2 {
    margin: 16rpx 0rpx 0rpx 0rpx;
    // width: 500rpx;
  }

  .postquestionsDetails_fd5_1_c1_c1_c1 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .postquestionsDetails_fd5_1_c1_c1_c0 {
    margin: 0rpx 12rpx 0rpx 0rpx;
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .postquestionsDetails_fd5_1_c1_c1 {
    margin: 4rpx 0rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd5_1_c1_c0_c2 {
    background: rgba(100, 80, 235, 0.1);
    color: rgba(100, 80, 235, 1);
    font-size: 22rpx;
    font-weight: 700;
    line-height: 22rpx;
    padding: 2rpx 8rpx 2rpx 8rpx;
    border-radius: 4rpx;
    background-size: 100% auto;
  }

  .postquestionsDetails_fd5_1_c1_c0_c1 {
    background: rgba(255, 137, 46, 0.1);
    color: #FF892E;
    font-size: 22rpx;
    font-weight: 700;
    line-height: 22rpx;
    padding: 2rpx 8rpx 2rpx 8rpx;
    border-radius: 4rpx;
    background-size: 100% auto;
  }

  .postquestionsDetails_fd5_1_c1_c0_c0 {
    color: #333333;
    font-size: 24rpx;
    font-weight: 700;
    line-height: 32rpx;
    margin: 0rpx 8rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd5_1_c0 {
    width: 70rpx;
    height: 70rpx;
    border-radius: 50%;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd5_1 {
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd5_0_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .postquestionsDetails_flex_6 {
    background: rgba(255, 255, 255, 1);
    width: 750rpx;
    min-height: 98rpx;
    overflow: hidden;
    padding-bottom: 60rpx;
    z-index: 10;
    bottom: 0;
    box-shadow: 0rpx -1rpx 0rpx 1rpx rgba(0, 0, 0, 0.08);
    background-size: 100% auto;
  }

  .postquestionsDetails_fd6_0_c1_c0_c1 {
    color: #999999;
    font-size: 20rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .postquestionsDetails_fd6_0_c1_c0_c0 {
    width: 44rpx;
    height: 44rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd6_0_c1_c0 {
    margin: 0rpx 48rpx 0rpx 0rpx;
  }

  .postquestionsDetails_fd6_0_c0 {
    background: rgba(248, 248, 248, 1);
    margin: 0rpx 32rpx 0rpx 0rpx;
    padding: 16rpx 32rpx 16rpx 32rpx;
    border-radius: 40rpx;
    background-size: 100% auto;
  }

  .postquestionsDetails_fd6_0 {
    padding: 32rpx 36rpx 12rpx 32rpx;
  }
</style>
